<div class="" id="myModal">
    <div class="modal-header">
        <h3 style="text-transform: capitalize;">Sale Category</h3>
    </div>
</div>
<div style="margin: 5px 0">
    <a href="#myModal2" role="button" class="btn btn-primary btn-large" data-toggle="modal">Add new Real Category</a>
</div>
<table class="table table-bordered table-striped" id="realCategory">
    <tbody>
    <tr>
        <th>#</th>
        <th>RealCategoryName</th>
        <th>Order</th>
        <th>Action</th>
    </tr>
    <?php
    if ($this->RealCategories):
        foreach ($this->RealCategories as $realcategory):

            ?>
        <tr id='<?php echo $realcategory['RealCategoryID']; ?>-real-category'>

            <td><?php echo $realcategory['RealCategoryID'];?></td>
            <td><?php echo $realcategory['RealCategoryName'];?></td>
            <td><?php echo $realcategory['catOrder'];?></td>
            <td>
                <a href='#myModal3' role="button" data-params='<?php echo json_encode($realcategory); ?>' class="update btn btn-primary">Edit</a>
                <a role="button" class="btn delete">Delete</a>
            </td>
        </tr>
            <?php
        endforeach;
    endif;
    ?>
    </tbody>
</table>
<div class="pagination pagination-centered">
    <ul>
        <?php

        if ($this->pages) {
            for ($i = 1; $i <= $this->pages; $i++) {
                echo '<li><a href="/admin/realcategory/index/page/' . $i . '">' . $i . '</a></li>';
            }
        }
        ?>
    </ul>
</div>
<div id="myModal3" class="modal hide fade" aria-labelledby="myModalLabel" aria-hidden="true" role="dialog">
    <form method="post" action="/admin/realcategory/update" id="formUpdateReal">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            <h3 id="myModalLabel">Update Real Category</h3>
        </div>

        <div class="modal-body">

            <label>Real Category Name</label>
            <input type="text" name="catName" id="ucatName" placeholder="Sale Category Name…">
            <label>Order</label>
            <input type="text" name="catOrder" id="ucatOrder" class="input-small" placeholder="Order...">
            <label>Desc</label>
            <textarea  name="catDesc" id="ucatDesc" class="input-large" placeholder="Desc..."></textarea>
            <input type="hidden" name="catId" id="catId">
        </div>
        <div class="modal-footer">
            <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
            <button class="btn btn-primary" type="submit">Save changes</button>
        </div>
    </form>
</div>

<div id="myModal2" class="modal hide fade" aria-labelledby="myModalLabel" aria-hidden="true" role="dialog">
    <form method="post" action="/admin/realcategory/create" id="formCreateRealCat">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            <h3 id="myModalLabel">Add new Real Category</h3>
        </div>

        <div class="modal-body">

            <label>Real Category Name</label>
            <input type="text" name="catName" id="catName" placeholder="Sale Category Name…">
            <label>Order</label>
            <input type="text" name="catOrder" id="catOrder" class="input-small" placeholder="Order...">
            <label>Desc</label>
            <textarea  name="catDesc" id="catDesc" class="large" placeholder="Desc..."></textarea>
        </div>
        <div class="modal-footer">
            <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
            <button class="btn btn-primary" type="submit">Save changes</button>
        </div>
    </form>

</div>